﻿using Domain.Infrastructure;

namespace Application.Infrastructure
{
    /// <summary>
    /// 具有（更新）约束的 服务基类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class BaseService_M<T> : BaseService<T> where T : class, IModifyAudited, new()
    { 
        protected BaseService_M(ILog log, IRepositoryBase<T> repository, string userId) : base(log, repository, userId)
        {
        }

        public override bool Update(T entity)
        {
            entity.Modify(UserId, entity.Id);
            return Repository.Update(entity);
        }


    }
}
